#pragma once

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#define DEFAULT_LOGCPLUS_LAYOUT_PATTERN "%D{YYYY/MM/DD hhmmss}:%5T:%6P:%18F:%4L:"

#include "logcplus_util.h"

namespace logcplus
{
	class logcplus_layout
	{
	private:
		char m_layout[80];
		bool m_format;
	public:
		logcplus_layout();
		explicit logcplus_layout(const char* sLayout);
		~logcplus_layout();

		void  setLayout(const char* sLayout);
		void  setFormat(bool format);
		char* formatLayout(const char* File, const char* Function, int Line,int Level,char* outbuf);
	};
}
